package com.zhu.pre.mapper;

import com.sanploy.common.domain.Banner;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by zhu yingzhi on 2017/10/12.
 * @author yingzhi zhu
 * 手机轮播图注释添加
 */
@Mapper
public interface MBannerMapper {

    /**
     * 查找所有的轮播图
     * @return 轮播图 集合
     */
    @Select("SELECT * FROM banner ORDER BY sort_order DESC ")
    List<Banner> findAllBanner();

    /**
     * 通过id 查找轮播图
     * @param id 轮播图id
     * @return 轮播图实体
     */
    @Select("SELECT * FROM banner WHERE id=#{id}")
    Banner findById(@Param("id") Long id);

}
